import os
from dotenv import load_dotenv 
# load_dotenv("..\.env")

# print(os.getenv("MYSQL_USER"))

env_path = os.path.join(os.path.dirname(__file__), "../../.env")
load_dotenv(env_path)
print("=== 环境变量加载结果 ===")
print(f"MYSQL_HOST: {os.getenv('MYSQL_HOST')}")  # 应输出 localhost
print(f"MYSQL_USER: {os.getenv('MYSQL_USER')}")  # 应输出 root
print(f"MYSQL_PASSWORD: {os.getenv('MYSQL_PASSWORD') or '空'}")  # 输出你的密码或空
print(f"MYSQL_DB_USER: {os.getenv('MYSQL_DB_USER')}")  # 应输出 user_db
print(f"MYSQL_DB_FRIEND: {os.getenv('MYSQL_DB_FRIEND')}")  # 应输出 friend_db
print("=======================")